package com.situ.day5;

import org.junit.Test;

public class ArrayDemo {

	@Test
	public void test1() {
		int[] array = new int[4];
		array[0] = 13;
		array[1] = 28;
		array[2] = 69;
		array[3] = 7;
//		for (int i = 0; i < array.length; i++) {
//			System.out.print(array[i] + "\t");
//		}
		for (int i = array.length - 1; i >= 0; i--) {
			System.out.print(array[i] + "\t");
		}
	}
	
	@Test
	public void test2() {
		int sum = 0;
		int[] array = new int[] {65, 87, 91, 77, 53};
		for (int i = 0; i < array.length; i++) {
			sum = sum + array[i];
		}
		System.out.println(sum);
	}
}
